<?php

class PlaneController extends BaseController {

	/*
	|--------------------------------------------------------------------------
	| 登陆控制器
	|--------------------------------------------------------------------------
	|
	| 登陆、验证、登出  功能
	|
	*/

	//登陆
	public function index()
	{
		if(Auth::check()){
			return Redirect::route('home');
		}else{
			return View::make('login.index');
		}
	}

	// 添加计划
	public function add(){
		return View::make('plane.add');
	}
	// 添加计划逻辑
	public function store(){
		$input = Input::all();
		$input['days'] = (int)$input['days'];
		$input['plane_count'] = (int)$input['plane_count'];
		$input['plane_conver_start'] = (float)(explode(';', $input['fanwei'])[0])/100;
		$input['plane_conver_end'] = (float)(explode(';', $input['fanwei'])[1])/100;
		$input['lock']=0;
		unset($input['fanwei']);unset($input['_token']);

		$plane = Plane::create($input);
		var_dump($input);
		
		
	}



}
